﻿<UserControl x:Class="ThumbGen.MetadataControl"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:local="clr-namespace:ThumbGen">
    <UserControl.Resources>
        <BooleanToVisibilityConverter x:Key="Bool2VisibConverter"/>
    </UserControl.Resources>
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="*"/>
            <RowDefinition Height="Auto"/>
        </Grid.RowDefinitions>
        <StackPanel Orientation="Vertical" Grid.Row="0" Margin="10">
            <TextBlock Text="This is a preview loaded from the ThumbGen's metadata file." HorizontalAlignment="Center"/>
            <TextBlock x:Name="HintBox" x:FieldModifier="public" FontSize="9" Text="Use the buttons below the image to import parts of it inside the currently chosen sheet" HorizontalAlignment="Center" Margin="0 3 0 0"
                       Visibility="{Binding Path=IsToolbarVisible, Converter={StaticResource Bool2VisibConverter}}"/>
        </StackPanel>
        <Border Grid.Row="1" BorderBrush="White" BorderThickness="1" Height="180" Width="320" 
                            VerticalAlignment="Center" HorizontalAlignment="Center" AllowDrop="False" >
            <Image x:Name="MovieSheetSmallImage" Stretch="Uniform" x:FieldModifier="public"/>
        </Border>
        <StackPanel Orientation="Horizontal" VerticalAlignment="Center" HorizontalAlignment="Right" Grid.Row="2" x:Name="ButtonsBar" x:FieldModifier="public" 
                    Visibility="{Binding Path=IsToolbarVisible, Converter={StaticResource Bool2VisibConverter}}">
            <TextBlock Text="Use in Editor: " VerticalAlignment="Center"/>
            <Button Margin="2 0 0 0" VerticalAlignment="Center" 
                                        Command="{x:Static local:ResultsListBox.UseFromMetadataRoutedCommand}" CommandParameter="ALL"  ToolTip="Use all available items from metadata into the Editor">
                <Image Source="/images/done.png" Width="16" Height="16" VerticalAlignment="Center"/>
            </Button>
            <Button Margin="5 0 0 0" VerticalAlignment="Center" 
                                        Command="{x:Static local:ResultsListBox.UseFromMetadataRoutedCommand}" CommandParameter="COVER" ToolTip="Use cover from metadata into the Editor">
                <Image Source="/images/image.png" Width="16" Height="16" VerticalAlignment="Center"/>
            </Button>
            <Button Margin="2 0 0 0" VerticalAlignment="Center" 
                                        Command="{x:Static local:ResultsListBox.UseFromMetadataRoutedCommand}" CommandParameter="BACKGROUND" ToolTip="Use background from metadata into the Editor">
                <Image Source="/images/backdrop.png" Width="16" Height="16" VerticalAlignment="Center"/>
            </Button>
            <Button Margin="2 0 0 0" VerticalAlignment="Center" 
                                        Command="{x:Static local:ResultsListBox.UseFromMetadataRoutedCommand}" CommandParameter="F1" ToolTip="Use fanart1 from metadata into the Editor">
                <Image Source="/images/fanart1.png" Width="16" Height="16" VerticalAlignment="Center"/>
            </Button>
            <Button Margin="2 0 0 0" VerticalAlignment="Center" 
                                        Command="{x:Static local:ResultsListBox.UseFromMetadataRoutedCommand}" CommandParameter="F2" ToolTip="Use fanart2 from metadata into the Editor">
                <Image Source="/images/fanart2.png" Width="16" Height="16" VerticalAlignment="Center"/>
            </Button>
            <Button Margin="2 0 0 0" VerticalAlignment="Center" 
                                        Command="{x:Static local:ResultsListBox.UseFromMetadataRoutedCommand}" CommandParameter="F3" ToolTip="Use fanart3 from metadata into the Editor">
                <Image Source="/images/fanart3.png" Width="16" Height="16" VerticalAlignment="Center"/>
            </Button>
            <Button Margin="2 0 0 0" VerticalAlignment="Center" 
                                        Command="{x:Static local:ResultsListBox.UseFromMetadataRoutedCommand}" CommandParameter="NFO" ToolTip="Use movieinfo(incl.mediainfo) from metadata into the Editor">
                <Image Source="/images/movie.png" Width="16" Height="16" VerticalAlignment="Center"/>
            </Button>
        </StackPanel>
    </Grid>
</UserControl>
